package com.wang.springbootinit.controller;


import com.wang.springbootinit.common.BaseResponse;
import com.wang.springbootinit.common.ResultUtils;
import com.wang.springbootinit.model.param.AnswerOperateParam;
import com.wang.springbootinit.model.vo.AnswerVO;
import com.wang.springbootinit.service.AnswerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * 聊天
 */
@Slf4j
@RestController
@RequestMapping("/answer")
public class AnswerController {

    @Resource
    private AnswerService answerService;

    /**
     * 简单答疑
     * @param param
     * @return
     */
    @PostMapping("/get/simple")
    public BaseResponse<AnswerVO> simpleGet(@RequestBody AnswerOperateParam param, HttpServletRequest request){
        AnswerVO result = answerService.answerQuestion(param,request);
        return ResultUtils.success(result);
    }
}
